# 
# Copyright (C) 2006 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
# $Id: Makefile 9906 2007-12-25 01:40:47Z nbd $

include $(TOPDIR)/rules.mk
#include $(INCLUDE_DIR)/kernel.mk

PKG_NAME:=TestOBUBroadcast
PKG_VERSION:=1.0
PKG_RELEASE:=1

include $(INCLUDE_DIR)/package.mk

TestOBUBroadcast_SRC_DIR:=$(PKG_BUILD_DIR)/src
TestOBUBroadcast_BIN:=$(PKG_BUILD_DIR)/TestOBUBroadcast

define Package/TestOBUBroadcast
  SUBMENU:=SDK Apps
  TITLE:=Sample TestOBUBroadcast SDK app.
  URL:=http://savari.net/
  DEPENDS:=
  FILES:=TestOBUBroadcast
endef

define Package/TestOBUBroadcast/description
 This package contains a sample TestOBUBroadcast SDK application.
endef

define Build/Prepare
	# Add any preparation statements like copying.
	$(CP) -r src/* $(PKG_BUILD_DIR)/
endef

define Build/Configure
	# Add any configuration statements like running config script.
endef

MAKE_ARGS:=SAVARI_CC="$(TARGET_CROSS)g++" SAVARI_LD="$(TARGET_CROSS)g++" STRIP=$(STRIP) \
	   CFLAGS="$(TARGET_CFLAGS)" \
	   LDFLAGS="$(TARGET_LDFLAGS) -static" \
	   INCLUDES="-I$(STAGING_DIR)/include -I$(STAGING_DIR)/usr/include" \
	   TGT=$(TestOBUBroadcast_BIN) \
	   LIBS="-L$(STAGING_DIR)/usr/lib -lnetsnmp"

define Build/Compile
	# Add any compile statements
	$(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_ARGS) all
endef

define Build/InstallDev
	#
	# Add any development install cmd like copying header files.
endef

define Build/Clean
	$(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_ARGS) clean
endef

define Package/TestOBUBroadcast/install
	$(INSTALL_DIR) $(1)/usr/local
	$(INSTALL_DIR) $(1)/usr/local/lib
	$(INSTALL_DIR) $(1)/usr/local/bin
	$(INSTALL_DIR) $(1)/usr/local/etc
	#$(INSTALL_CONF) config files $(1)/lib/etc  # conf files
	$(INSTALL_BIN) $(TestOBUBroadcast_BIN) $(1)/usr/local/bin # binaries
	#$(INSTALL_DATA) $(TestOBUBroadcast_BIN) $(1)/usr/local/etc # data files
endef

$(eval $(call BuildPackage,TestOBUBroadcast))
